package com.mapper;

import com.dto.LoginDto;
import com.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LoginMapper {

    /**
     * 用户登录
     * @param loginDto
     * @return
     */
    @Select("select * from user where phone=#{phone} and password=#{password}")
    User login(LoginDto loginDto);

    /**
     * 用户注册
     * @param user
     */
    @Insert("insert into user (id,name,phone,password,head) value (#{id},#{name},#{phone},#{password},#{head})")
    void register(User user);
}
